feat: support custom per-instance OpenTelemetry TracerProvider#517
Merged
rbarbadillo merged 1 commit intomainfrom May 7, 2026
Conversation
louis-sanna-dev
requested changes
May 6, 2026
Contributor
|
Actually I see hooks are NOT* documented in Agents.md. here is the doc https://www.speakeasy.com/docs/sdks/customize/code/sdk-hooks , it's already used a lot in this repo. |
0cfb147 to
fde0f9f
Compare
…r_provider
Add a set_tracer_provider(client, provider) helper that attaches a custom
TracerProvider to a specific Mistral client instance. Spans produced by
that client are emitted through the custom provider; other instances
continue using the global provider.
Usage:
from mistralai.extra.observability import set_tracer_provider
set_tracer_provider(client, my_provider)
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
fde0f9f to
adeff87
Compare
louis-sanna-dev
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a hook-based helper for per-instance OpenTelemetry tracing in the Python SDK.
set_tracer_provider(client, provider)attaches a customTracerProviderto a specificMistralclient instance, so spans emitted by that client go through the provided OTEL pipeline while other SDK instances continue using the global provider.Changes
mistralai.extra.observability.set_tracer_providerTracingHookto use a configured per-instance providerget_or_create_otel_tracer()to accept an optional providerUsage